package org.vaadin.example.nf4v.demo.ui.main.pages;

import com.vaadin.ui.Button;
import com.vaadin.ui.Label;
import com.vaadin.ui.VerticalLayout;
import org.vaadin.nf4v.core.navigation.NavigationManager;
import org.vaadin.nf4v.ext.config.menu.Menu;

/**
 * Application's main context home page
 */
@Menu(name = "Welcome", weight = -1)
public class WelcomePage extends VerticalLayout{

    public WelcomePage() {
        Label label = new Label("Example of cross context navigation");
        addComponent(label);
        Button button = new Button("Go to admin context", new Button.ClickListener(){
            @Override
            public void buttonClick(Button.ClickEvent event) {
                NavigationManager.navigateTo("admin");
            }
        });
        addComponent(button);
    }
}
